<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>上传功能测试类</title>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>

	<form id="uploadForm" method="post" enctype="multipart/form-data" >
		<input id="prodImageUpload" type="file" 	name="file" > 
	</form>
	<br>
	<br>
	<br>
	<form id="uploadForm2" method="post" enctype="multipart/form-data" >
		<input id="prodImageUpload2" type="file" 	name="file" > 
	</form>
</body>

<script type="text/javascript">

var fileObj = $("#prodImageUpload");
fileObj.change(function(){ 
    var formData = new FormData($("#uploadForm")[0]);
    $.ajax({
        type: "POST",
        url: "http://localhost/youtui/predict/upload.do",
        data: formData,
        async: false,
        cache: false,
        contentType: false,
        processData: false,
        success: function (data) {
            var obj = $.parseJSON(data);
            alert(obj)
        }
    })
});


var fileObj2 = $("#prodImageUpload2");
fileObj2.change(function(){ 
    var formData = new FormData($("#uploadForm2")[0]);
    $.ajax({
        type: "POST",
        url: "http://localhost/youtui/actual/upload.do",
        data: formData,
        async: false,
        cache: false,
        contentType: false,
        processData: false,
        success: function (data) {
            var obj = $.parseJSON(data);
            alert(obj)
        }
    })
});

</script>
</html>